<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/myorder-changepassword.css" />
		<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="css/header.css"/>
		<link rel="shortcut icon" type="image/x-icon" href="img/3.ico" media="screen" />
		<!--		<script src="js/PCASClass.js" type="text/javascript" charset="utf-8"></script>
-->
	</head>

	<body>
		<div class="change-pwd-header">
			<div class="change-pwd-header-main">
				<a href="http://www.baofeng.com/">
					<div class="change-pwd-header-logo"></div>
				</a>
				<div class="change-pwd-header-indextext">
					<a href="homepage.html">首页</a>
				</div>
				<div class="change-pwd-header-daohang">导航
					<div class="change-pwd-header-daohang-icon"></div>
				</div>
				<div class="change-pwd-header-daohang-input">
					<input type="text" placeholder="暴风影音" class="change-pwd-header-daohang-input-text"></input>
					<div class="change-pwd-header-daohang-input-bton"></div>

				</div>
				<div class="change-pwd-header-view">
					<div class="change-pwd-header-view-icon"></div>看过
					<div class="change-pwd-header-view-box">
						暂时没有您的观看记录
						<div class="change-pwd-header-view-box-arrow">
							<div class="change-pwd-header-view-box-sarrow"></div>
						</div>
						<div class="change-pwd-header-view-box-line"></div>
						您喜欢的影片在这里
					</div>
				</div>
				<div class="change-pwd-header-collect">
					<div class="change-pwd-header-collect-icon"></div>收藏
					<div class="change-pwd-header-collect"></div>
				</div>
				<div class="change-pwd-header-download">
					<div class="change-pwd-header-download-icon"></div>下载
				</div>
				<div class="change-pwd-header-touxiang"></div>
			</div>
		</div>
		<div class="change-pwd-grey">
			<div class="change-pwd-grey-main">
				<div class="change-pwd-left">
					<div class="change-pwd-left-touxiang-box">
						<div class="change-pwd-left-touxiang"></div>
						<div class="change-pwd-left-touxiang-name">1326_1302_4</div>
						<div class="change-pwd-left-touxiang-vip">开通会员</div>
						<div class="change-pwd-left-touxiang-tequan">开通会员享受更多特权</div>
					</div>
					<ul class="change-pwd-grey-list">
						<li>
							<a href="change-pwd-myindex"> 我的首页</a>
						</li>
						<li>VIP会员</li>
						<li>观看记录</li>
						<li>我的收藏</li>
						<li>我的消息</li>
						<li>我的奖品</li>
						<li>我的券码</li>
						<li>账号设置</li>
					</ul>
				</div>

				<div class="layui-tab">
					<ul class="layui-tab-title change-pwd-right-title">
						<li class="layui-this">基本信息</li>
						<li>头像管理</li>
						<li>地址设置</li>
						<li>安全管理</li>

					</ul>
					<div class="layui-tab-content">
						<div class="layui-tab-item layui-show">
							亲爱的1326_1302_4，填写真实的资料，有助于更好的为您服务。<br /> 生日：
							<div class="layui-inline change-pwd-right-message-date" id="birthday">
								<!-- 注意：这一层元素并不是必须的 -->
								<input type="text" class="layui-input" id="test1">

							</div>
							<br />
							<div class="change-pwd-right-message-sex">
								性别：<input type="radio" name="sex" value="0" title="男" class="zz">男
								<input style="margin-left: 25px;" type="radio" name="sex" value="1" title="女" class="zz" checked>女</div>
							教育：
							<select name="city" class="change-pwd-right-message-edu" lay-verify="required">
								<option value="">请选择</option>
								<option value="小学">小学</option>
								<option value="初中">初中</option>
								<option value="高中">高中</option>
								<option value="大专">大专</option>
								<option value="本科">本科</option>
								<option value="硕士">硕士</option>
								<option value="博士">博士</option>
							</select>
							<br />职业：
							<select name="city" class="change-pwd-right-message-job" lay-verify="required">
								<option value="">请选择</option>
								<option value="计算机">计算机</option>
								<option value="金融">金融</option>
								<option value="制药">制药</option>
								<option value="广告">广告</option>
								<option value="房地产">房地产</option>
								<option value="物流">物流</option>
								<option value="保险">保险</option>
							</select>
							<br />收入：
							<select name="pay" class="change-pwd-right-message-salary" lay-verify="required">
								<option value="">请选择</option>
								<option value="1000">1000</option>
								<option value="2100">2100</option>
								<option value="3000">3000</option>
								<option value="4100">4100</option>
								<option value="5100">5100</option>
								<option value="6100">6100</option>
								<option value="7100">7100</option>
							</select>
							<div class="change-pwd-right-message-sex">婚姻：<input type="radio" name="marr" value="未婚" title="男">未婚
								<input style="margin-left: 25px;" type="radio" name="marr" value="已婚" title="女" checked>已婚</div>
							<div id="change-info" class="change-pwd-main-save">保存</div>
						</div>
						<div class="layui-tab-item">
							<div class="change-pwd-main-settouxiang-bton">选择您要上传得头像</div>
						</div>
						<div class="layui-tab-item">
							<div class="change-pwd-right-realname-box">
								真实姓名：<input type="text" class="change-pwd-right-realname" />
							</div>
							<div class="change-pwd-right-realname-box">
								联系电话：<input type="text" class="change-pwd-right-realname" />
							</div>

							<div class="change-pwd-right-realname-box">
								详细地址：<input type="text" class="change-pwd-right-realname" />
							</div>
							<div id="message-bton" class="change-pwd-main-save area-save">保存</div>
						</div>
						<div class="layui-tab-item">
							<div class="layui-tab layui-tab-card">
								<ul class="layui-tab-title">
									<li class="layui-this">绑定手机</li>
									<li>修改密码</li>
									<li>绑定邮箱</li>

								</ul>
								<div class="layui-tab-content " style="height: 300px;">
									<div class="layui-tab-item layui-show">绑定手机可以用于登录暴风账号、找回密码、安全及提醒服务。<br/>手机号：13260701302已绑定
									</div>
									<div class="layui-tab-item">
										<div class="change-pwd-right-realname-box">
											原密码：<input type="password" class="change-pwd-yuan-pwd" style="border:1px black solid;margin-top: -10px;margin-left: 12px;"/>
										</div>
										<div class="change-pwd-right-realname-box">
											新密码：<input type="password" class="change-pwd-new-pwd" style="border:1px black solid;margin-top: -10px;margin-left: 12px;"/>
										</div>
										<div class="change-pwd-right-realname-box">
											确认密码：<input type="password" class="change-pwd-sure-pwd" style="border:1px black solid;margin-top: -10px;"/>
										</div>
										<div id="change-pwd-save-bton" class="change-pwd-main-save area-save">保存</div>
									</div>
									<div class="layui-tab-item ">
										<div class="change-pwd-right-safe-tip">您还没有绑定邮箱。绑定邮箱可以用于登录暴风账号、找回密码、安全及提醒服务。</div>
										<div class="change-pwd-right-realname-box">
											邮箱地址：<input type="text" class="change-pwd-right-realname" />

										</div>
										<div class="change-pwd-right-realname-box">
											确认邮箱：<input type="text" class="change-pwd-right-realname" />
											<button class="change-pwd-right-confirm-email">发送邮箱验证码</button>

										</div>
										<div class="change-pwd-main-save area-save">绑定邮箱</div>
										<div class="change-pwd-right-safe-tip">
											<div class="change-pwd-right-safe-tip">您还没有绑定邮箱。绑定邮箱可以用于登录暴风账号、找回密码、安全及提醒服务。</div>
										</div>
									</div>

								</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
	</body>

	<script type="text/javascript" src="js/layui/layui.js"></script>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script src="js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/distpicker.data.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/distpicker.data.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/distpicker.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/distpicker.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/distpicker.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/login.js" type="text/javascript" charset="utf-8"></script>
<script src="js/alertLogin.js" type="text/javascript" charset="utf-8"></script>
<script src="js/header.js" type="text/javascript" charset="utf-8"></script>
<script src="js/addheader.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function () {
		$("body").addHeader()
	var myDate = new Date();
		layui.use('laydate', function() {
			var laydate = layui.laydate;

			//执行一个laydate实例
			laydate.render({
				elem: '#test1'//指定元素
				
 
               ,max: 'myDate '
			});
		});
		layui.use('element', function() {
			var element = layui.element;

			//…
		});
		$("#distpicker2").distpicker({
			province: "---- 所在省 ----",
			city: "---- 所在市 ----",
			district: "---- 所在区 ----"
		});

		
		var thisid = $.cookie("userId")
		$("#change-pwd-save-bton").click(function() {
			var oldpwd = $(".change-pwd-yuan-pwd").val()
			var surepwd = $(".change-pwd-sure-pwd").val()
			var newpwd1 = $(".change-pwd-new-pwd").val()
           
           
			if(surepwd === newpwd1) {
				$.post("/changepawd", {
					newpwd: newpwd1,

					id: thisid,
					oldpwd: oldpwd
				}, function(data) {
					alert(data.msg)
					if(data.msg=="恭喜，修改成功")
					location.href="login.html"
				$.removeCookie("userId");
				
				})

			} else {
				alert("您两次输入的密码不一致，请核对后再输入")
			}
		})
		//修改个人信息
		var thisid = $.cookie("userId")
		$("#change-info").click(function() {
			id: thisid
			var birth = $("#test1").val()
			var sex = $("[name ='sex']:checked").val() //伪类选择器
			var edu = $(".change-pwd-right-message-edu").val()
			var job = $(".change-pwd-right-message-job").val()
			var pay = $(".change-pwd-right-message-salary").val()
			var marriage = $("[name ='marr']:checked").val()

			$.post('/changeuserinfo', {
				birth: birth,
				sex: sex,
				edu: edu,
				job: job,
				pay: pay,
				marriage: marriage,
				id:thisid
			}, function(data) {
				alert(data.msg)
			})
		})
		//查询个人信息
		$.get(' /userinfo', {
					id:thisid
				}, function(data) {
					
					$("#test1").val(data.user_birth)
					$(".change-pwd-right-message-edu").val(data.user_edu)
					$(".change-pwd-right-message-job").val(data.user_job)
					$(".change-pwd-right-message-salary").val(data.user_pay)
				
				}
			)
		
})
	
	</script>

</html>